package com.agentfactory.teleoreactive.debugger.inspector;

import java.util.Observable;

import com.agentfactory.platform.core.IScheduler;
import com.agentfactory.teleoreactive.debugger.TeleoReactiveStateManager;
import com.agentfactory.visualiser.core.IAgentInspector;
import com.agentfactory.visualiser.core.IInspectorFactory;
import com.agentfactory.visualiser.core.IStateManager;

public class TeleoReactiveInspectorFactory implements IInspectorFactory {

    public IAgentInspector create(IStateManager manager, IScheduler scheduler) {
        TeleoReactiveInspector inspector = new TeleoReactiveInspector();
        inspector.init(manager, scheduler);
        ((Observable) manager).addObserver(inspector);
        return inspector;
    }

	public boolean handles(IStateManager manager) {
        return TeleoReactiveStateManager.class.isInstance(manager);
    }

}
